Next | Prev | Up | Top | Contents | Index
Overview of Host Adapter Functions
IRIX 6.2 permits a total of 10 unique host adapter drivers, but each of the ten must provide the same functional interface, which is based on simple concepts. The interface to host adapter drivers is declared in sys/scsi.h. Each adapter driver must provide the functions listed in Table 15-2.
Host Adapter Function Summary
Function | Header Files | Can Sleep? | Purpose |
---|
scsi_info(D3) | scsi.h | Y | Issue the SCSI Inquiry command and return the results. |
scsi_alloc(D3) | scsi.h | Y | Open a connection between a driver and a target device. |
scsi_free(D3) | scsi.h | Y | Release connection to target device. |
scsi_command(D3) | scsi.h | Y? | Transmit a SCSI command on the bus and return results. |
scsi_abort() | scsi.h | Y? | Transmit a SCSI ABORT command (see caution). |
scsi_reset() | scsi.h | Y? | Reset the SCSI adapter or bus (see caution). |
The normal sequence of operations is as follows:
- In the pfxopen() entry point (or, rarely, in an initialization entry point), the device driver calls scsi_info() to test the device characteristics. The results verify that the target device exists and is of the expected type.
- In the pfxopen() entry point, the device driver calls scsi_alloc() to set up communications with the target device. This allocates resources in the host adapter driver.
- In the pfxstrategy() or pfxioctl() entry points, the device driver constructs SCSI command strings and calls scsi_command() to have them executed.
- In the pfxclose() entry point, the device driver calls scsi_free() to release any held resources related to this device.
Caution: The program interface to the scsi_abort() and scsi_reset() functions is likely to change in a near-future release. If you need these powerful functions, it is a good idea to code the function calls as macros that can easily be changed.
Next | Prev | Up | Top | Contents | Index